// 工作流函数
var Workflow = {   
    Current_View: "WorkflowDefs",
    
    Ajax_Response: ""
};

Workflow.extend = function(o, p){
    //if(argumnets.length > 1 && (p == null || p == undefined))
    //    return o;
    if (!p) {p = o; o = this;}  
    for (var i in p) o[i] = p[i];  
    return o;
};

// ajax
Workflow.extend ({ 
    ajaxAction: function(params) {
        var url = '../stringRes?s=workflowAction';
        $.get(url, params, this.ajaxResponse);
    },
    ajaxResponse: function(result) {
        //var xmlData = result.responseText;
        var xmlData = result;
        var isRun = false;
        for(var p in Workflow.prototype) {
            if(typeof(Workflow.prototype[p]) == "function") {
                if(p == Workflow.Ajax_Response) {
                    isRun = true;
                    Workflow.prototype[p](xmlData);
                }
            }
        }
        if(!isRun) {
            alert(xmlData);
        }
    }
});


